package com.rin.design_pattern.singleton;

/**
 * @author RinMi
 * @since 2023/5/26
 */
public class Singleton {

    private static final Singleton SINGLETON = new Singleton();

    private String message;

    private Singleton() {
    }

    public static Singleton newInstance() {
        return SINGLETON;
    }

    public void showMessage(String message) {
        setMessage(message);
        System.out.println(this.message);
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
